package com.jeesite.common.web;

import java.util.List;

public class ResponseDataList<T> {

    private String resultCode;

    private String msg;

    private List<T> data;

    public static <T> ResponseDataList<T> success(List<T> data) {
        ResponseDataList<T> response = new ResponseDataList<>();
        response.setResultCode("SUCCESS");
        response.setData(data);
        return response;
    }

    public static <T> ResponseDataList<T> error(String msg) {
        ResponseDataList<T> response = new ResponseDataList<>();
        response.setMsg(msg);
        response.setResultCode("FAIL");
        return response;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultCode() {
        return resultCode;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }
}
